﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;

namespace SPMonkey.Core
{
    public class BaseContext : IDisposable
    {
        protected readonly SPWeb _web;
        protected bool dispose = false;

        public SPWeb Web { get { return _web; } }

        public BaseContext()
        {
            this._web = SPContext.Current.Web;
        }

        public BaseContext(SPWeb web)
        {
            this._web = web;
        }

        #region IDisposable Members

        public void Dispose()
        {
            if (dispose)
            {
                this._web.Dispose();
            }
        }

        #endregion
    }
}